<?php

	require_once('model/model.php');
	require_once('model/ParamInOut.php');
	
	$md = new Model();
	$menuList = $md->getMenuList(-1);
	if(count($menuList)==0)
	{
		echo 'Data not found';
		return;	
	}
	
	//Lay thong tin idmn tren url
	$idmn ="";
	if(isset($_GET['idmn']))
	{
		$idmn="&idmn=".$_GET['idmn'];
	}
	
	// active list menu
	$strActiveMenu = 'id="active_menu"';
	echo '<table width="100%" border="0" cellpadding="0" cellspacing="0">';
	for($i=0;$i<count($menuList);$i++)
	{
		$obj = new GetMenuListResponse();
		$obj = $menuList[$i];
		if($_GET["idmnl"]==$obj->IdCatalogue)
		{
			echo'<tr >';
			echo '<td><a href="?idmnl='.$obj->IdCatalogue.$idmn.'" class="mainlevel"'.$strActiveMenu.'>'.$obj->MenuName.'</a></td></tr>';
			echo'<tr >';
		}
		else
		{
			echo'<tr >';
			echo '<td><a href="?idmnl='.$obj->IdCatalogue.$idmn.'" class="mainlevel">'.$obj->MenuName.'</a></td></tr>';
			echo'<tr >';
		}
		

	}
	echo '</table>';



?>